home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-03-26 | 1.3 KB | 57 lines | [TEXT/MPS ] |
- c
- c F_Launch
- c
- c A FORTRAN-callable version of the _Launch trap.
- c
- c Takes one argument, a character variable or constant,
- c the name of the application to launch.
- c
- c Trims trailing spaces from the application name,
- c then executes the _Launch trap with an old-style
- c parameter block. This causes the current application
- c to terminate (no return to calling program).
- c
- c The launched application opens in the foreground under
- c MultiFinder and System 7.
- c
- c Example:
- c
- c call F_Launch('myprog')
- c
- c Terminates the current program and launches 'myprog'
- c in the foreground under MultiFinder or System 7.
- c
- c NOTE: Be sure to save data structures and close open
- c files before calling F_Launch!
- c
- c
- subroutine F_Launch(name)
- character*(*) name
- structure /OldLaunchParms/
- pointer /string/ namep
- integer*2 flags1,flags2
- end structure
- record /OldLaunchParms/ LaunchRec
- integer*2 I$$$HEX
- integer*4 Areg0,Areg1
- string appname
-
- appname = trim(name)
-
- c set up the short launch parameter block
- LaunchRec.namep = %loc(appname)
- LaunchRec.flags1 = 0 ! always
- LaunchRec.flags2 = 0 ! always
-
- c get a pointer to it in A0
- c NOTE: this will not work if you compile with -debug options!
- !!BKG-
- Areg0 = %loc(LaunchRec)
- Areg1 = 0
- call LoadAddressReg(Areg0,Areg1)
-
- c execute the _Launch trap (does not return)
- I$$$HEX = $A9F2
- end
-
-